package com.zpark.controller;

import com.zpark.client.UserFeignClient;
import com.zpark.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * TODO
 *
 * @Description
 * @Author zhangbing
 * @Date 2024/4/22 10:36
 **/
@RestController
@RequestMapping("/cf")
public class FeignController {

    @Resource
    private UserFeignClient userFeignClient;

    //http://User-Service2104/user/"+id
    @GetMapping("/{id}")
    public User findById(@PathVariable Long id){

        return userFeignClient.findById(id);
    }

}
